﻿using System;
using System.Web.Mvc;

namespace Avalon.Core.MVC.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class TabAttribute : Attribute, IMetadataAware
    {
        public const string Key = "TabName";

        public string TabName { get; set; }

        public TabAttribute(string tabName)
        {
            TabName = tabName;
        }

        public void OnMetadataCreated(ModelMetadata metadata)
        {
            metadata.AdditionalValues[Key] = TabName;
        }
    }
}
